package com.moleq.models;

import com.moleq.db.DatabaseSchema;

public class MixMatch {

	private int mm_no;
	private String upc;
	private int index;

	public int getIndex() {
		return index;
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public MixMatch() {
	}

	public int getMm_no() {
		return mm_no;
	}

	public void setMm_no(int mm_no) {
		this.mm_no = mm_no;
	}

	public String getUpc() {
		return upc;
	}

	public void setUpc(String upc) {
		this.upc = upc;
	}

	public MixMatch(int mm_no, String upc) {
		this.mm_no = mm_no;
		this.upc = upc;

	}

	public MixMatch(int mm_no) {
		this.mm_no = mm_no;

	}

	public MixMatch(int mm_no, String upc, int index) {
		this.mm_no = mm_no;
		this.upc = upc;
	}

	public String toMGData(String Action) {
		String Result = Action + "|" + DatabaseSchema.MixMatch.SCHEMA_NAME
				+ "|(" + getMm_no() + "," + CheckNull(getUpc()) + ")";
		return Result;
	}
	
	public String CheckNull(String value) {
		if (value == null) {
			return null;
		} else {
			return "'" + value + "'";
		}
	}

}
